

public class TestDemo {

    public static void main2(String[] args) {
        String str = "frost";
        str = str + " cold";
        str = str + "!!!";
        System.out.println(str); // 输出：frost cold
    }

    public static void main(String[] args) {
//        String str = "frost";
//        str = str + " cold";
//        System.out.println(str); // 输出：frost cold

        String str = "frost";
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        sb.append("cold");
        str = sb.toString();
        System.out.println(str); // 输出：frost cold
    }


}
